package config

// 环境变量, starting with FC_
const (
	FC_SERVER_PORT      = "FC_SERVER_PORT"
	FC_SERVER_LOG_LEVEL = "FC_SERVER_LOG_LEVEL"
	FC_CONCURRENT_LIMIT = "FC_CONCURRENT_LIMIT" // 单实例最大并发数
	FC_INSTANCE_ID      = "FC_INSTANCE_ID"
	FC_REGION           = "FC_REGION"

	FC_FUNC_NAME    = "FC_FUNC_NAME"
	FC_FUNC_MEMORY  = "FC_FUNC_MEMORY"
	FC_FUNC_HANDLER = "FC_FUNC_HANDLER" // e.g. main
)

const (
	// Default values
	DefaultPort       = "8080"
	DefaultFuncType   = "event" // event function
	DefaultConcurrent = "1"
	DefaultRequestID  = "default-id"

	// 基本函数类型，http/event
	EventFunction = "event"
	HttpFunction  = "http"

	HTTP_OK           = 200
	HTTP_NOT_FOUND    = 404
	HTTP_SERVER_ERROR = 500

	ContentTypeJSON    = "application/json"
	MAX_TAIL_LOG_BYTES = 1024 * 4

	UnhandledInvocationError = "UnhandledInvocationError"
)

// request/response headers
const (
	CONTENT_TYPE   = "Content-Type"
	CONTENT_LENGTH = "Content-Length"
	CONNECTION     = "Connection"

	//REQUEST_ID  = "x-fc-request-id"
	REQUEST_ID = "x-request-id"

	H_RETURN_REQUEST_ID = "x-fc-request-id" // 返回给客户端的 id 字段名
	H_ACCOUNT_ID        = "x-fc-account-id"
	H_REGION            = "x-fc-region"
	H_FUNC_NAME         = "x-fc-function-name"
	H_FUNC_HANDLER      = "x-fc-function-handler"
	H_FUNC_MEMORY       = "x-fc-function-memory"
	H_ACCESS_KEY_ID     = "x-fc-access-key-id"
	H_ACCESS_KEY_SECRET = "x-fc-access-key-secret"

	SECURITY_TOKEN = "x-fc-security-token"

	LOG_TYPE   = "x-fc-log-type"
	LOG_RESULT = "x-fc-log-result"
	ERR_Header = "X-Fc-Error-Type"
)
